package com.blackfish.customer;

import java.util.List;

import com.blackfish.common.model.Customer;
import com.blackfish.common.model.PathConfig;

public class CustomerService {
	private static final Customer dao = new Customer().dao();
	
	public String getNameById(int id){
		return this.findById(id).getViewname();
	}
	
	public Customer findById(int id) {
		return dao.findById(id);
	}
	
	public void deleteById(int id) {
		dao.deleteById(id);
	}
	
	public List<Customer> findAll(){
		return dao.find("select * from customer order by id asc");
	}
	
	public int getIdByName(String viewName){
		return dao.findFirst("select * from customer where name='"+viewName+"'").getId();
	}
}
